import 'package:flutter/widgets.dart';
import 'package:flutter/material.dart';
class StateLifeCirclePage extends StatefulWidget{
  const StateLifeCirclePage({Key key,this.initValue}):super(key:key);
  final int  initValue;

  @override
  _StateLifeCirclePage createState()=>new _StateLifeCirclePage();
}
class _StateLifeCirclePage extends State<StateLifeCirclePage>{
  int _count;

  @override
  void initState() {
    print("initState");
    super.initState();
    _count=widget.initValue;
  }

  @override
  Widget build(BuildContext context) {
    print("build");
    return Scaffold(
      appBar: AppBar(title: Text("StateLifeCirclePage"),),
      body: Center(
        child: FlatButton(
            onPressed: (){
              setState(() {
                ++_count;
              });
            },
            child: Text("$_count")),
      ),
    );
  }

  @override
  void didUpdateWidget(StateLifeCirclePage oldWidget) {
    super.didUpdateWidget(oldWidget);
    print("didUpdateWidget");
  }

  @override
  void reassemble() {
    super.reassemble();
    print("reassemble");
  }

  @override
  void setState(VoidCallback fn) {
    super.setState(fn);
    print("setState");
  }

  @override
  void deactivate() {
    super.deactivate();
    print("deactivate");
  }

  @override
  void dispose() {
    super.dispose();
    print("dispose");
  }

  @override
  void didChangeDependencies() {
    super.didChangeDependencies();
    print("didChangeDependencies");
  }

}